package edu.moravian.entity;

import edu.moravian.math.Point2D;
import edu.moravian.math.Vector2D;
import java.util.List;

/**
 *
 * @author ronaghan
 */
public class Ordinance extends Entity
{

    public Ordinance(Point2D location, Vector2D heading, double speed, double mass, double radius, String type)
    {
        super(location, heading, speed, mass, radius, type);
    }
    
 
    @Override
    public synchronized void update(double delta)
    {
        this.location.scalePlusEquals(speed*delta, heading);
    }
    
    public synchronized void affectEnemies(List<Enemy> enemies)
    {
        if(enemies.isEmpty() == false)
        {
            if(enemies.get(0) != null)
            {
                enemies.get(0).setHealth(-1);
            }
        }
    }
    
    
}
